AC_INIT([Typer], [0.4.2], [juanmabcmail@gmail.com], [typer])
AC_CONFIG_HEADERS(config.h)
AM_INIT_AUTOMAKE(no-dist-gzip dist-bzip2)

AC_SUBST(PACKAGE_AUTHOR, ["Juan Manuel Borges Caño"])
AC_SUBST(PACKAGE_DESCRIPTION, ["GNOME Typing Learner/Trainer"])
AC_SUBST(PACKAGE_HOMEPAGE, ["http://code.google.com/p/gnome-typer"])
AC_SUBST(PACKAGE_MONTH, [$(LANG=C date '+%B')])
AC_SUBST(PACKAGE_YEAR, [$(LANG=C date '+%Y')])
AC_SUBST(PACKAGE_PARSE, ["sed -e 's,\@<:@@\@:>@pkg\@<:@@\@:>@,\$(PACKAGE),g' -e 's,\@<:@@\@:>@pkgname\@<:@@\@:>@,\$(PACKAGE_NAME),g' -e 's,\@<:@@\@:>@pkgversion\@<:@@\@:>@,\$(PACKAGE_VERSION),g' -e 's,\@<:@@\@:>@pkgauthor\@<:@@\@:>@,\$(PACKAGE_AUTHOR),g' -e 's,\@<:@@\@:>@pkgmonth\@<:@@\@:>@,\$(PACKAGE_MONTH),g' -e 's,\@<:@@\@:>@pkgyear\@<:@@\@:>@,\$(PACKAGE_YEAR),g' -e 's,\@<:@@\@:>@pkghomepage\@<:@@\@:>@,\$(PACKAGE_HOMEPAGE),g' -e 's,\@<:@@\@:>@pkgbugreport\@<:@@\@:>@,\$(PACKAGE_BUGREPORT),g' -e 's,\@<:@@\@:>@pkgdescription\@<:@@\@:>@,\$(PACKAGE_DESCRIPTION),g' -e 's,\@<:@@\@:>@pkgdatadir\@<:@@\@:>@,\$(pkgdatadir),g'"])

# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O

AC_CHECK_PROG(HAVE_SED, sed, yes)
[[ -z $HAVE_SED ]] && AC_MSG_ERROR(sed is needed to create and execute this program)

AC_CHECK_PROG(HAVE_SH, sh, yes)
[[ -z $HAVE_SH ]] && AC_MSG_ERROR(sh is needed to execute this program)

AC_CHECK_PROG(HAVE_WC, wc, yes)
[[ -z $HAVE_WC ]] && AC_MSG_ERROR(wc is needed to execute this program)

AC_CHECK_PROG(HAVE_FORTUNE, fortune, yes)
[[ -z $HAVE_FORTUNE ]] && AC_MSG_ERROR(fortune is needed to execute this program)

# Checks for libraries.
DEP_MODULES="gtk+-3.0 libgnomekbd libgnomekbdui"
PKG_CHECK_MODULES(DEPS, $DEP_MODULES)
AC_SUBST(DEPS_CFLAGS)
AC_SUBST(DEPS_LIBS)

# Checks for header files.
AC_STDC_HEADERS

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.

AC_CONFIG_FILES([Makefile src/Makefile data/Makefile])
AC_OUTPUT
